<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 定义字符串
        var str = "i come from beijing";
        var arr = str.split(" ");
        arr.reverse();
        str = arr.join(" ");
        console.log(str);
    </script>
</head>
<body>
    
</body>
</html>